package playbook

import (
	"time"

	. "gddgame.cc/galaxy/common/dsl/game"
	. "gddgame.cc/galaxy/common/dsl/game/task"
	"gddgame.cc/galaxy/utils/def"
)

type SceneManager interface {
	Judge(factors []Factor) bool
	JudgePlayer(player *Player, factors []Factor) bool
	NewNotice(data map[string]interface{})
	GetStat(sourceKey SourceKey, key string) int32
	GetPlayerStat(player *Player, sourceKey SourceKey, key string) int32
	MaxStat() map[string][]string
	StartTime() *time.Time
}

type Scene interface {
	def.ID
	Data() *Data
	Bind(manager SceneManager)
	Ticker() time.Duration
	GenerateTargetList() []int
	GenerateObjectList() []int
	Tasks() map[int]*GameTask
	GetPlayerInfo(player *Player, taskIds []int)

	InitScene(players []*Player) InfoArray
	InitPlayer(player *Player) InfoArray
	Start(finish chan<- struct{})
	UpdatePlayer(player *Player) InfoArray
	UpdateTicker(languages []string) InfoArray
	UpdateData() InfoArray
	Refresh(players []*Player)

	Finish(pb *Playbook)
}
